package com.mzq.langchain4j_springboot.web.controller;

import com.mzq.langchain4j_springboot.config.AiConfig;
import com.mzq.langchain4j_springboot.web.entity.MaintenanceRecord;
import com.mzq.langchain4j_springboot.web.service.MaintenanceRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/system/maintenanceRecord")
public class MaintenanceRecordController {

    @Autowired
    private MaintenanceRecordService maintenanceRecordService;

    @Autowired
    AiConfig.AssistantUnique assistantUnique;

    @PostMapping("/insertMaintenanceRecord")
    public ResponseEntity<Integer> insertMaintenanceRecord(MaintenanceRecord maintenanceRecord) {
        return ResponseEntity.ok(maintenanceRecordService.insertMaintenanceRecord(maintenanceRecord));
    }

    @PutMapping("/updateMaintenanceRecord")
    public ResponseEntity<Integer> updateMaintenanceRecord(MaintenanceRecord maintenanceRecord) {
        return ResponseEntity.ok(maintenanceRecordService.updateMaintenanceRecord(maintenanceRecord));
    }
}
